package cn.jarlen.jwt.tools.menu;

import android.content.Context;
import android.widget.Toast;

import cn.jarlen.jwt.tools.x509.X509Utils;

import java.security.cert.X509Certificate;

/**
 * @author jarlen
 * Create by 2023/4/12 13:57
 */
public class X509Check implements IMenuProcess {

    @Override
    public void onExecute(Context context) {
        X509Certificate x509ByDefault = X509Utils.makeX509ByDefault(context);
        X509Certificate x509ByBCProvider = X509Utils.makeX509ByBCProvider(context);

        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("X509 默认解析").append(x509ByDefault != null ? "成功" : "失败").append("\n");
        stringBuilder.append("X509 BC解析").append(x509ByBCProvider != null ? "成功" : "失败");

        Toast.makeText(context, stringBuilder, Toast.LENGTH_LONG).show();
    }
}
